<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>OpenFOAM-3.0 的湍流模型（三） | Giskard&#39;s CFD Learning Tricks</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="有了上一篇的基础，就很容易做到添加新的湍流模型了，这里分别给出对四类湍流模型增加新模型的方法。探索过程不详述了，仅给出结果。">
<meta property="og:type" content="article">
<meta property="og:title" content="OpenFOAM-3.0 的湍流模型（三）">
<meta property="og:url" content="http://xiaopingqiu.github.io/2016/04/24/TurbulenceModel-30-NewModels/index.html">
<meta property="og:site_name" content="Giskard's CFD Learning Tricks">
<meta property="og:description" content="有了上一篇的基础，就很容易做到添加新的湍流模型了，这里分别给出对四类湍流模型增加新模型的方法。探索过程不详述了，仅给出结果。">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="OpenFOAM-3.0 的湍流模型（三）">
<meta name="twitter:description" content="有了上一篇的基础，就很容易做到添加新的湍流模型了，这里分别给出对四类湍流模型增加新模型的方法。探索过程不详述了，仅给出结果。">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

##ga('create', '[object Object]', 'auto');
ga('create', 'UA-62501686-1', 'auto');
ga('send', 'pageview');

</script>
<!-- End Google Analytics -->


</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Giskard&#39;s CFD Learning Tricks</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">CFD and Scientific Computing</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
          <a class="main-nav-link" href="/atom.xml">Rss</a>
        
          <a class="main-nav-link" href="/about">About</a>
        
      </nav>
      <nav id="sub-nav">
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="q" value="site:http://xiaopingqiu.github.io"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-TurbulenceModel-30-NewModels" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2016/04/24/TurbulenceModel-30-NewModels/" class="article-date">
  <time datetime="2016-04-24T15:34:01.000Z" itemprop="datePublished">2016-04-24</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/OpenFOAM/">OpenFOAM</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      OpenFOAM-3.0 的湍流模型（三）
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>有了上一篇的基础，就很容易做到添加新的湍流模型了，这里分别给出对四类湍流模型增加新模型的方法。探索过程不详述了，仅给出结果。</p>
<a id="more"></a>
<h5 id="3-_添加新模型的方法。">3. 添加新模型的方法。</h5><p>添加湍流模型，关键的有两个，一是如果将新湍流模型添加到合适的 hashTable，以便能被求解器调用，另一个是 Make/files 和 Make/options 的写法以使湍流模型能被编译。</p>
<p>这里不给出具体湍流模型的代码，仅给出 Make 的写法，以及一个 <code>.C</code> 文件。编译湍流模型的时候，新建一个目录，将需要编译的湍流模型代码、这里给出的对应类型的 <code>.C</code> 文件和 Make 文件夹都拷贝到新建的目录，然后运行 <code>wmake libso</code> 即可。</p>
<h6 id="3-1_单相不可压缩湍流模型">3.1 单相不可压缩湍流模型</h6><ul>
<li>makeTuebulenceModels.C</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "IncompressibleTurbulenceModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "incompressible/transportModel/transportModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "addToRunTimeSelectionTable.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "makeTurbulenceModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "RASModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "LESModel.H"</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 宏函数定义</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeRASModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (transportModelIncompressibleTurbulenceModel, RAS, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeLESModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (transportModelIncompressibleTurbulenceModel, LES, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="comment">// RAS models</span></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="keyword">namespace</span> Foam</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">typedef</span> IncompressibleTurbulenceModel&lt;transportModel&gt; transportModelIncompressibleTurbulenceModel; </span><br><span class="line">    </span><br><span class="line">    <span class="keyword">typedef</span> RASModel&lt;transportModelIncompressibleTurbulenceModel&gt; RAStransportModelIncompressibleTurbulenceModel;    </span><br><span class="line">    </span><br><span class="line">    <span class="keyword">typedef</span> LESModel&lt;transportModelIncompressibleTurbulenceModel&gt; LEStransportModelIncompressibleTurbulenceModel; </span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// 这里说明一下，编译新的模型，最重要的是将作为模板类的通用湍流模型代入合适的模板参数以实例化，然后将实例化的模型添加到合适的　hashTable。</span></span><br><span class="line"><span class="comment">// 上面定义的几个别名，是为了下面将模型添加到 hashTable 而服务的，至于为什么要定义这几个别名，参考前一篇的 `makeBaseTurbulenceModel` 宏函数的展开部分。</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mykEpsilon.H"</span></span><br><span class="line">makeRASModel(mykEpsilon); <span class="comment">// 如前篇所属，这个宏函数，先对模板类进行了实例化，然后调用 `addToRunTimeSelectionTable` 宏函数，将实例化模型添加到 hashTable。</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="comment">// LES models</span></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mySmagorinsky.H"</span></span><br><span class="line">makeLESModel(mySmagorinsky);</span><br></pre></td></tr></table></figure>
<ul>
<li><p>Make/files</p>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">makeTuebulenceModels.C</span><br><span class="line"></span><br><span class="line"><span class="constant">LIB</span> = <span class="variable">$(FOAM_USER_LIBBIN)</span>/libTestincompressibleTurbulenceModels</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/options</p>
<figure class="highlight haml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">EXE_INC = \</span><br><span class="line">    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/turbulenceModels/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/incompressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/finiteVolume/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/meshTools/lnInclude \</span><br><span class="line"></span></span><br><span class="line">LIB_LIBS = \</span><br><span class="line">    -<span class="ruby">lincompressibleTransportModels \</span><br><span class="line"></span>    -<span class="ruby">lturbulenceModels \</span><br><span class="line"></span>    -<span class="ruby">lfiniteVolume \</span><br><span class="line"></span>    -<span class="ruby">lmeshTools</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<h6 id="3-2_单相可压缩湍流模型">3.2 单相可压缩湍流模型</h6><ul>
<li><p>makeTurbulenceModels.C</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "CompressibleTurbulenceModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "compressibleTransportModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "fluidThermo.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "addToRunTimeSelectionTable.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "makeTurbulenceModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "ThermalDiffusivity.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "EddyDiffusivity.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "RASModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "LESModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeRASModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (fluidThermoCompressibleTurbulenceModel, RAS, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeLESModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (fluidThermoCompressibleTurbulenceModel, LES, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">namespace</span> Foam</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">typedef</span> ThermalDiffusivity&lt;CompressibleTurbulenceModel&lt;fluidThermo&gt; &gt;  fluidThermoCompressibleTurbulenceModel;    </span><br><span class="line"></span><br><span class="line">    <span class="keyword">typedef</span> RASModel&lt;EddyDiffusivity&lt;fluidThermoCompressibleTurbulenceModel&gt; &gt;  RASfluidThermoCompressibleTurbulenceModel;       </span><br><span class="line"></span><br><span class="line">    <span class="keyword">typedef</span> LESModel&lt;EddyDiffusivity&lt;fluidThermoCompressibleTurbulenceModel&gt; &gt;  LESfluidThermoCompressibleTurbulenceModel;       </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="comment">// RAS models</span></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mykEpsilon.H"</span></span><br><span class="line">makeRASModel(mykEpsilon);</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mybuoyantKEpsilon.H"</span></span><br><span class="line">makeRASModel(mybuoyantKEpsilon);</span><br><span class="line"></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="comment">// LES models</span></span><br><span class="line"><span class="comment">// -------------------------------------------------------------------------- //</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mySmagorinsky.H"</span></span><br><span class="line">makeLESModel(mySmagorinsky);</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/files</p>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">makeTurbulenceModels.C</span><br><span class="line"></span><br><span class="line"><span class="constant">LIB</span> = <span class="variable">$(FOAM_USER_LIBBIN)</span>/libTestcompressibleTurbulenceModels</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/options</p>
<figure class="highlight haml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">EXE_INC = \</span><br><span class="line">    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/compressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/turbulenceModels/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels/compressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/basic/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/specie/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/solidThermo/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/solidSpecie/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/finiteVolume/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/meshTools/lnInclude \</span><br><span class="line"></span></span><br><span class="line">LIB_LIBS = \</span><br><span class="line">    -<span class="ruby">lcompressibleTransportModels \</span><br><span class="line"></span>    -<span class="ruby">lfluidThermophysicalModels \</span><br><span class="line"></span>    -<span class="ruby">lsolidThermo \</span><br><span class="line"></span>    -<span class="ruby">lsolidSpecie \</span><br><span class="line"></span>    -<span class="ruby">lturbulenceModels \</span><br><span class="line"></span>    -<span class="ruby">lspecie \</span><br><span class="line"></span>    -<span class="ruby">lfiniteVolume \</span><br><span class="line"></span>    -<span class="ruby">lmeshTools</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>注意，由于在 <code>TurbulenceModels/compressible/lnInclude</code> 和 <code>TurbulenceModels/turbulenceModels/lnInclude</code> 两个目录下，都存在 <code>makeTurbulenceModel.H</code> 头文件，内容是不一样的，这里需要 include 的是前者，所以在 <code>Make/options</code> 里， <code>TurbulenceModels/compressible/lnInclude</code> 一定要写在前面才能编译成功。</p>
<h6 id="3-3_多相不可压缩湍流模型">3.3 多相不可压缩湍流模型</h6><ul>
<li><p>DPMTurbulenceModels.C</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "PhaseIncompressibleTurbulenceModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "singlePhaseTransportModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "addToRunTimeSelectionTable.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "makeTurbulenceModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//#include "laminar.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "turbulentTransportModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "LESModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeRASModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, RAS, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeLESModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, LES, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">namespace</span> Foam</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">typedef</span> PhaseIncompressibleTurbulenceModel&lt;singlePhaseTransportModel&gt; singlePhaseTransportModelPhaseIncompressibleTurbulenceModel; </span><br><span class="line">    </span><br><span class="line">    <span class="keyword">typedef</span> RASModel&lt;singlePhaseTransportModelPhaseIncompressibleTurbulenceModel&gt; RASsinglePhaseTransportModelPhaseIncompressibleTurbulenceModel;      </span><br><span class="line">    </span><br><span class="line">    <span class="keyword">typedef</span> LESModel&lt;singlePhaseTransportModelPhaseIncompressibleTurbulenceModel&gt; LESsinglePhaseTransportModelPhaseIncompressibleTurbulenceModel;      </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mykEpsilon.H"</span></span><br><span class="line">makeRASModel(mykEpsilon);</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mySmagorinsky.H"</span></span><br><span class="line">makeLESModel(mySmagorinsky);</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/files</p>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">DPMTurbulenceModels.C</span><br><span class="line"></span><br><span class="line"><span class="constant">LIB</span> = <span class="variable">$(FOAM_USER_LIBBIN)</span>/libTestDPMTurbulenceModels</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/options</p>
<figure class="highlight haml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">EXE_INC = \</span><br><span class="line">    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels/compressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/basic/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels/incompressible/singlePhaseTransportModel \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/turbulenceModels/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/incompressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/phaseIncompressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/finiteVolume/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/meshTools/lnInclude</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>注意，这里的湍流模型是给 <code>DPMFoam</code> 求解器用的，如果要给其他求解器写湍流模型，可能需要做些修改。</p>
<h6 id="3-4_多相可压缩湍流模型">3.4 多相可压缩湍流模型</h6><ul>
<li><p>phaseCompressibleTurbulenceModels.C</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "PhaseCompressibleTurbulenceModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "phaseModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "twoPhaseSystem.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "addToRunTimeSelectionTable.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "makeTurbulenceModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "ThermalDiffusivity.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "EddyDiffusivity.H"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//#include "laminar.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "RASModel.H"</span></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "LESModel.H"</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeRASModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">define</span> makeLESModel(Type)                                                     \</span><br><span class="line">    makeTemplatedTurbulenceModel                                               \</span><br><span class="line">    (phaseModelPhaseCompressibleTurbulenceModel, LES, Type)</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">namespace</span> Foam</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">typedef</span> ThermalDiffusivity&lt;PhaseCompressibleTurbulenceModel&lt;phaseModel&gt; &gt;  phaseModelPhaseCompressibleTurbulenceModel;  </span><br><span class="line"></span><br><span class="line">    <span class="keyword">typedef</span> RASModel&lt;EddyDiffusivity&lt;phaseModelPhaseCompressibleTurbulenceModel&gt; &gt;  RASphaseModelPhaseCompressibleTurbulenceModel;           </span><br><span class="line">    </span><br><span class="line">    <span class="keyword">typedef</span> LESModel&lt;EddyDiffusivity&lt;phaseModelPhaseCompressibleTurbulenceModel&gt; &gt;   LESphaseModelPhaseCompressibleTurbulenceModel;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mykEpsilon.H"</span></span><br><span class="line">makeRASModel(mykEpsilon);</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "mySmagorinsky.H"</span></span><br><span class="line">makeLESModel(mySmagorinsky);</span><br><span class="line"></span><br><span class="line"><span class="preprocessor">#<span class="keyword">include</span> "myphasePressureModel.H"</span></span><br><span class="line">makeTurbulenceModel</span><br><span class="line">(phaseModelPhaseCompressibleTurbulenceModel, RAS, myphasePressureModel);</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/files</p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">phaseCompressibleTurbulenceModels<span class="class">.C</span></span><br><span class="line">phasePressureModel/myphasePressureModel<span class="class">.C</span></span><br><span class="line"></span><br><span class="line">LIB = $(FOAM_USER_LIBBIN)/libTestphaseCompressibleTurbulenceModels</span><br></pre></td></tr></table></figure>
</li>
<li><p>Make/options</p>
<figure class="highlight haml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">EXE_INC = \</span><br><span class="line">    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">WM_PROJECT_DIR</span>)/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">WM_PROJECT_DIR</span>)/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels/compressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/thermophysicalModels/basic/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/transportModels/incompressible/transportModel \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/compressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/turbulenceModels/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/<span class="constant">TurbulenceModels</span>/phaseCompressible/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/finiteVolume/lnInclude \</span><br><span class="line"></span>    -<span class="ruby"><span class="constant">I</span><span class="variable">$(</span><span class="constant">LIB_SRC</span>)/meshTools/lnInclude</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>注意，这里的湍流模型是给求解器 <code>twoPhaseEulerFoam</code> 用的，如果要给其他求解器开发湍流模型，可能需要做些修改。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://xiaopingqiu.github.io/2016/04/24/TurbulenceModel-30-NewModels/" data-id="cj2lay35e004jkkmbr9x1m6tz" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Code-Explained/">Code Explained</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/turbulence-model/">turbulence model</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2016/04/25/TurbulenceModel-30-macro/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          OpenFOAM-3.0 的湍流模型（四）
        
      </div>
    </a>
  
  
    <a href="/2016/04/24/TurbulenceModel-30-RTS/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">OpenFOAM-3.0 的湍流模型（二）</div>
    </a>
  
</nav>

  
</article>


<section id="comments">
  <!-- 多说评论框 start -->
  <div class="ds-thread" data-thread-key="post-TurbulenceModel-30-NewModels" data-title="OpenFOAM-3.0 的湍流模型（三）" data-url="http://xiaopingqiu.github.io/2016/04/24/TurbulenceModel-30-NewModels/"></div>
  <!-- 多说评论框 end -->
  <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
  <script type="text/javascript">
  var duoshuoQuery = {short_name:"xiaopingqiu"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
  <!-- 多说公共JS代码 end -->
</section>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/C/">C++</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/DEM/">DEM</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/OpenFOAM/">OpenFOAM</a><span class="category-list-count">44</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Paraview/">Paraview</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/swak4Foam/">swak4Foam</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/test/">test</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/vim/">vim</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Boundary-conditions/">Boundary conditions</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/C/">C++</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CentOS/">CentOS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Code-Explained/">Code Explained</a><span class="tag-list-count">29</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/LES/">LES</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/LIGGGHTS/">LIGGGHTS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ODE/">ODE</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/OpenFOAM/">OpenFOAM</a><span class="tag-list-count">20</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Postprocessing/">Postprocessing</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Preprocessing/">Preprocessing</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/RTS/">RTS</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TIL/">TIL</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Windows/">Windows</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fvOptions/">fvOptions</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovyBC/">groovyBC</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/paraview/">paraview</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/test/">test</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/thermophysicalModels/">thermophysicalModels</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/turbulence-model/">turbulence model</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vim/">vim</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wall-functions/">wall functions</a><span class="tag-list-count">4</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Boundary-conditions/" style="font-size: 15.56px;">Boundary conditions</a><a href="/tags/C/" style="font-size: 11.11px;">C++</a><a href="/tags/CentOS/" style="font-size: 10px;">CentOS</a><a href="/tags/Code-Explained/" style="font-size: 20px;">Code Explained</a><a href="/tags/LES/" style="font-size: 10px;">LES</a><a href="/tags/LIGGGHTS/" style="font-size: 10px;">LIGGGHTS</a><a href="/tags/ODE/" style="font-size: 10px;">ODE</a><a href="/tags/OpenFOAM/" style="font-size: 18.89px;">OpenFOAM</a><a href="/tags/Postprocessing/" style="font-size: 17.78px;">Postprocessing</a><a href="/tags/Preprocessing/" style="font-size: 11.11px;">Preprocessing</a><a href="/tags/RTS/" style="font-size: 12.22px;">RTS</a><a href="/tags/TIL/" style="font-size: 10px;">TIL</a><a href="/tags/Windows/" style="font-size: 10px;">Windows</a><a href="/tags/fvOptions/" style="font-size: 11.11px;">fvOptions</a><a href="/tags/groovyBC/" style="font-size: 10px;">groovyBC</a><a href="/tags/paraview/" style="font-size: 10px;">paraview</a><a href="/tags/test/" style="font-size: 11.11px;">test</a><a href="/tags/thermophysicalModels/" style="font-size: 14.44px;">thermophysicalModels</a><a href="/tags/turbulence-model/" style="font-size: 16.67px;">turbulence model</a><a href="/tags/vim/" style="font-size: 10px;">vim</a><a href="/tags/wall-functions/" style="font-size: 13.33px;">wall functions</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/">五月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">八月 2016</a><span class="archive-list-count">8</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/06/">六月 2016</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/05/">五月 2016</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">四月 2016</a><span class="archive-list-count">12</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">三月 2016</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">十二月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">十一月 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">十月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">九月 2015</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">八月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/06/">六月 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/05/">五月 2015</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/04/">四月 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2017/05/12/duoshuoAnnouncement/">多说评论系统将停止提供服务</a>
          </li>
        
          <li>
            <a href="/2016/08/27/ParaviewScritps/">Paraview 脚本一例</a>
          </li>
        
          <li>
            <a href="/2016/08/27/ParaviewCamera/">Paraview 中有关 Camera 的操作两例</a>
          </li>
        
          <li>
            <a href="/2016/08/27/ParaviewCustomFilter/">Paraview 中创建 Custom Filter</a>
          </li>
        
          <li>
            <a href="/2016/08/27/ParaviewStreamLineOnSlice/">在 Paraview 中画截面上的流线</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2017 Giskard Q.<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

<script src="//dn-lbstatics.qbox.me/lbservice/busuanzi/2.0/busuanzi.mini.js"/></script>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
    <a href="/atom.xml" class="mobile-nav-link">Rss</a>
  
    <a href="/about" class="mobile-nav-link">About</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-62501686-1', 'auto');
  ga('send', 'pageview');

</script>

  </div>
<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</body>
</html>